<?php
/**
 * @copyright  For copyright and license information, read the COPYING.txt file.
 * @link       /COPYING.txt
 * @license    Academic Free License (AFL 3.0)
 * @package     default_default
 */

/**
 * Admin login form template
 *
 * @see Mage_Oauth_Block_Adminhtml_Oauth_Authorize
 * @var Mage_Oauth_Block_Adminhtml_Oauth_Authorize $this
 */

 ?>
<div class="login-container">
    <div class="login-box">
        <div class="login-form">
            <?php echo $this->getMessagesBlock()->toHtml() ?>
            <?php if (!$this->getHasException()): ?>
                <form method="post" action="<?php echo $this->getPostActionUrl() ?>" id="loginForm">
                    <?php echo $this->getBlockHtml('formkey'); ?>
                    <fieldset>
                        <input name="form_key" type="hidden" value="<?php echo $this->getFormKey() ?>" />
                        <h2><?php echo $this->__('Log in to Admin Panel'); ?></h2>
                        <p class="description"><?php echo $this->__('Log in to use <strong>%s</strong>', $this->getConsumer()->getName()) ?></p>
                        <div class="input-box input-left"><label for="username"><?php echo $this->__('User Name:') ?></label><br/>
                            <input type="text" id="username" name="login[username]" value="" class="required-entry input-text" /></div>
                        <div class="input-box input-right"><label for="login"><?php echo $this->__('Password:') ?></label><br />
                            <!-- This is a dummy hidden field to trick firefox from auto filling the password -->
                            <input type="password" class="input-text no-display" name="dummy" id="dummy" />
                            <input type="password" id="login" name="login[password]" class="required-entry input-text" value="" autocomplete="new-password"/></div>
                        <div class="clear"></div>
                        <div class="form-buttons">
                            <button type="submit" class="form-button" title="<?php echo $this->quoteEscape($this->__('Login')) ?>" ><?php echo $this->__('Login') ?></button>
                            <button onclick="document.location.href='<?php echo $this->getRejectUrl() ?>'; return false;" title="<?php echo $this->quoteEscape($this->__('Reject')) ?>"><?php echo $this->__('Reject') ?></button>
                        </div>
                        <input type="hidden" name="oauth_token" value="<?php echo $this->escapeHtml($this->getToken()) ?>"/>
                    </fieldset>
                </form>
                <script type="text/javascript">
                //<![CDATA[
                     var loginForm = new varienForm('loginForm');
                //]]>
                </script>
            <?php endif ?>
        </div>
        <p class="legal"><?php echo $this->__('Magento is a trademark of Magento Inc. Copyright &copy; %s Magento Inc.', date('Y')) ?></p>
        <div class="bottom"></div>
    </div>
</div>
